package com.jiaquyun.jcps.mode.api

import com.jiaquyun.jcps.entity.*
import com.jiaquyun.jcps.mode.BaseApi
import com.lemlin.network.HttpServiceApi
import com.lemlin.network.HttpServiceData
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Query

interface Mine2Api : HttpServiceApi {

    /**
     * 个人页数据
     * */
    @GET("/rider/user/personal_data")
    fun personalData(@Header("token") token: String): Observable<PersonalResponse>

    /**
     * 今日数据
     * */
    @GET("/rider/user/today_data")
    fun todayData(@Header("token") token: String): Observable<TodayResponse>

    /**
     * 获取个人信息
     * */
    @GET("/rider/user/get_user_info")
    fun userInfo(@Header("token") token: String): Observable<UserInfo2Response>

    /**
     * 结算
     * @param token 身份
     * */
    @POST("/rider/user/cash_add")
    fun cashAdd(@Header("token") token: String): Observable<HttpServiceData>

    /**
     * 结算记录
     * @param token 身份
     * @param page 页数
     * @param limit 条数
     * */
    @GET("/rider/user/cash_log")
    fun cashLog(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<SettleResponse>

    @GET("/rider/user/punch_the_clock")
    fun punchTheClock(
        @Header("token") token: String
    ): Observable<SignClockResponse>

    @GET("/rider/user/go_to_work")
    fun goToWork(
        @Header("token") token: String
    ): Observable<HttpServiceData>

    @GET("/rider/user/go_off_work")
    fun goOffWork(
        @Header("token") token: String
    ): Observable<HttpServiceData>
}